<template>
    <div>
        <span>角色名：</span>{{role.roleName}}
        <br><br>
        <span>角色权限：</span>{{role.roleText}}
        <el-divider></el-divider>
        <Role_anthority v-on:refresh="refresh1" :role="id2"></Role_anthority>
    </div>
</template>

<script>

    import Management_anthorityService from '../../../model/mfy/system_user/Management_anthorityService.js'
    var management_anthorityService  = Management_anthorityService.getInstance();

    import Role_anthority from './Role_authority.vue'

    export default {
        name: "Management_authority",
        props:['id'],
        data(){
            return{
                id2:this.id,
                role:{},
            }
        },
        created(){
                this.getOne();
        },
        watch:{
            id:function () {
                this.id2=this.id
                this.getOne()
            }
        },
        methods:{
            getOne(){
                management_anthorityService.getOne(this.id2).then((response)=>{
                    this.role=response.data.data
                })
            },
            refresh1(){
                this.$emit("refresh3")
            }
        },
        components:{
            Role_anthority,
        }
    }
</script>

<style scoped>

</style>
